/**
 * 
 */
package com.redside.dao.hibernate;

import java.util.List;
import java.util.Map;

import com.redside.dao.QuestionDao;
import com.redside.model.survey.Question;

/**
 * @author <a href="mailto:pchapman@easystreet.net">Peter Chapman</a>
 *
 */
public class QuestionDaoHibernate extends GenericDaoHibernate<Question,Long> implements
		QuestionDao {

	
	public QuestionDaoHibernate() {
		super(Question.class);
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.QuestionDao#findAllForSurvey(java.lang.Long)
	 */
	public List<Question> findAllForSurvey(Long surveyId) {
		return getHibernateTemplate().find("from Question where survey.id = ?",surveyId);
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.QuestionDao#save(com.redside.model.survey.Question)
	 */
	public Question save(Question question) {
		return (Question) getHibernateTemplate().merge(question);
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.GenericDao#exists(java.io.Serializable)
	 */
	public boolean exists(Long id) {
		// TODO Auto-generated method stub
		return false;
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.GenericDao#findByNamedQuery(java.lang.String, java.util.Map)
	 */
	public List<Question> findByNamedQuery(String queryName,
			Map<String, Object> queryParams) {
		// TODO Auto-generated method stub
		return null;
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.GenericDao#get(java.io.Serializable)
	 */
	public Question get(Long id) {
		return (Question) getHibernateTemplate().get(Question.class,id);
	}

	/* (non-Javadoc)
	 * @see com.redside.dao.GenericDao#remove(java.io.Serializable)
	 */
	public void remove(Long id) {
		// TODO Auto-generated method stub

	}

}
